package com.leonzhangxf.guice.bill;

import com.leonzhangxf.guice.bill.domain.CreditCard;
import com.leonzhangxf.guice.bill.domain.Order;
import com.leonzhangxf.guice.bill.domain.Receipt;

/**
 * bill service
 *
 * @author leonzhangxf
 */
public interface BillingService {

    /**
     * Attempts to charge the order to the credit card.
     *
     * @param order      the order waiting to be pay.
     * @param creditCard target credit card with the order been disposed.
     * @return a receipt of the transaction. If the charge was successful, the
     * receipt will be successful. Otherwise, the receipt will contain a
     * decline note describing why the charge failed.
     */
    Receipt chargeOrder(Order order, CreditCard creditCard);
}
